<?php
/*
 * Filename: plugin/base/cms/stage1/content.php
 *
 * Stage 1 implies that no database configuration file has been created yet,
 * and in this stage such a file will be created.
 * The file will be created only after an initial connection has been made
 * and been verified as working.
 *
 * The database connection file is only created once the connection is tested
 * and working.
 *
 * TODO: make sure PDO is available and if not only support MySQL
 *
 */
?>

<h2>Stage 1: Database Configuration</h2>
<h5><p>Stage 1 implies that a database configuration file has yet to be created.
        You cannot continue without doing so first. For this select the
        appropriate connector and fill in the connection data.
        The file will be created only after an initial connection has been made
        and been verified as working.</p>
    <p>Keep in mind, PDO is used which enables the use of multiple DBMS
    connectors. PDO is only supported from PHP 5 and up. Earlier versions of
    PHP are supported, though not encouraged but are restricted, to MySQL only.
    </p> </h5>

<h6>Almost Alpha Note: Only MySQL and PHP > 5 are supported for the moment.</h6>

<form method="post" action="plugin/base/cms/stage1/submit.php" id="stage1">
    <div class="input-box">
        <label>Connector</label>
        <select name="dbms">

            <?php
            foreach (PDO::getAvailableDrivers() as $driver) {
                echo '<option>' . $driver . '</option>';
            }
            ?>
        </select>
    </div>

    <div class="input-box">
        <label>Host</label>
        <input type="text" name="dbhost" value="localhost" />
    </div>
    <div class="input-box">
        <label>Port</label>
        <input type="text" name="dbport" value="" />
    </div>

    <div class="input-box">
        <label>Database Name</label>
        <input type="text" name="dbname" value="cultuurdb"/>
    </div>

    <div class="input-box">
        <label>User Name</label>
        <input type="text" name="dbuser" value="root"/>
    </div>

    <div class="input-box">
        <label>Password</label>
        <input type="text" name="dbpass" value="usbw"/>
    </div>
    <div class="submit">
        <input type="submit" value="Submit" />
    </div>
</form>